#include <iostream>
using namespace std;

class EmployType 
{
public:
	virtual ~EmployType() {}
	virtual void paid()=0;
};

class Hourly: public EmployType 
{
public:
	void paid() 
	{
		cout << "pay the hourly salary" << endl;
	}
};

class Salaried: public EmployType 
{
public:
	void paid() 
	{
		cout << "pay the formal salary" << endl;
	}
};

class Employee 
{
private:
	EmployType* employType;
public:
	void setEmployType(EmployType* employType) 
	{
		this->employType = employType;
	}
	Employee(EmployType* employType) 
	{
		setEmployType(employType);
	}
	void salary() 
	{
		this->employType->paid();
	}
};

class Manager: public Employee 
{
public:
	Manager(EmployType* employType):Employee(employType) 
	{
		cout << ">>> This is an manager:" << endl;
	}
};

class Technican: public Employee 
{
public:
	Technican(EmployType* employType):Employee(employType) 
	{
		cout << ">>> This is a technican:" << endl;
	}
};

class Salesman: public Employee 
{
public:
	Salesman(EmployType* employType):Employee(employType) 
	{
		cout << ">>> This is a salesman:" << endl;
	}
};

int main() 
{
	EmployType* hourly = new Hourly();
	EmployType* salaried = new Salaried();
	Employee* hourlyManager = new Manager(hourly);
	hourlyManager->salary();
	Employee* salariedManager = new Manager(salaried);
	salariedManager->salary();
	Employee* hourlyTechnican = new Technican(hourly);
	hourlyTechnican->salary();
	Employee* salariedTechnican = new Technican(salaried);
	salariedTechnican->salary();
	Employee* hourlySalesman = new Salesman(hourly);
	hourlySalesman->salary();
	Employee* salariedSalesman = new Salesman(salaried);
	salariedSalesman->salary();
	return 0;
}
